3.3.65 \(\int \frac {\sqrt {a-a \cos (c+d x)}}{\sqrt {\cos (c+d x)}} \, dx\) [265]

Optimal. Leaf size=48 \[ -\frac {2 \sqrt {a} \tanh ^{-1}\left (\frac {\sqrt {a} \sin (c+d x)}{\sqrt {\cos (c+d x)} \sqrt {a-a \cos (c+d x)}}\right )}{d} \]

[Out]

-2*arctanh(sin(d*x+c)*a^(1/2)/cos(d*x+c)^(1/2)/(a-a*cos(d*x+c))^(1/2))*a^(1/2)/d

________________________________________________________________________________________

Rubi [A]
time = 0.04, antiderivative size = 48, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, integrand size = 26, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.077, Rules used = {2854, 213} \begin {gather*} -\frac {2 \sqrt {a} \tanh ^{-1}\left (\frac {\sqrt {a} \sin (c+d x)}{\sqrt {\cos (c+d x)} \sqrt {a-a \cos (c+d x)}}\right )}{d} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Sqrt[a - a*Cos[c + d*x]]/Sqrt[Cos[c + d*x]],x]

[Out]

(-2*Sqrt[a]*ArcTanh[(Sqrt[a]*Sin[c + d*x])/(Sqrt[Cos[c + d*x]]*Sqrt[a - a*Cos[c + d*x]])])/d

Rule 213

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(-(Rt[-a, 2]*Rt[b, 2])^(-1))*ArcTanh[Rt[b, 2]*(x/Rt[-a, 2])]
, x] /; FreeQ[{a, b}, x] && NegQ[a/b] && (LtQ[a, 0] || GtQ[b, 0])

Rule 2854

Int[Sqrt[(a_) + (b_.)*sin[(e_.) + (f_.)*(x_)]]/Sqrt[(c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)]], x_Symbol] :> Dist[
-2*(b/f), Subst[Int[1/(b + d*x^2), x], x, b*(Cos[e + f*x]/(Sqrt[a + b*Sin[e + f*x]]*Sqrt[c + d*Sin[e + f*x]]))
], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0] && EqQ[a^2 - b^2, 0] && NeQ[c^2 - d^2, 0]

Rubi steps

\begin {align*} \int \frac {\sqrt {a-a \cos (c+d x)}}{\sqrt {\cos (c+d x)}} \, dx &=\frac {(2 a) \text {Subst}\left (\int \frac {1}{-a+x^2} \, dx,x,\frac {a \sin (c+d x)}{\sqrt {\cos (c+d x)} \sqrt {a-a \cos (c+d x)}}\right )}{d}\\ &=-\frac {2 \sqrt {a} \tanh ^{-1}\left (\frac {\sqrt {a} \sin (c+d x)}{\sqrt {\cos (c+d x)} \sqrt {a-a \cos (c+d x)}}\right )}{d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [C] Result contains complex when optimal does not.
time = 0.55, size = 278, normalized size = 5.79 \begin {gather*} \frac {2 e^{i d x} \left (\tanh ^{-1}\left (\frac {e^{i d x}}{\sqrt {\cos (c)-i \sin (c)} \sqrt {\cos (c)+e^{2 i d x} (\cos (c)+i \sin (c))-i \sin (c)}}\right )+\tanh ^{-1}\left (\frac {\sqrt {\cos (c)+e^{2 i d x} (\cos (c)+i \sin (c))-i \sin (c)}}{\sqrt {\cos (c)-i \sin (c)}}\right )\right ) \sqrt {a-a \cos (c+d x)} \left (\cos \left (\frac {c}{2}\right )+i \sin \left (\frac {c}{2}\right )\right ) \sqrt {\cos (c)-i \sin (c)} \sqrt {e^{-i d x} \left (\left (1+e^{2 i d x}\right ) \cos (c)+i \left (-1+e^{2 i d x}\right ) \sin (c)\right )}}{d \left (i \left (-1+e^{i d x}\right ) \cos \left (\frac {c}{2}\right )-\left (1+e^{i d x}\right ) \sin \left (\frac {c}{2}\right )\right ) \sqrt {2 \left (1+e^{2 i d x}\right ) \cos (c)+2 i \left (-1+e^{2 i d x}\right ) \sin (c)}} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Sqrt[a - a*Cos[c + d*x]]/Sqrt[Cos[c + d*x]],x]

[Out]

(2*E^(I*d*x)*(ArcTanh[E^(I*d*x)/(Sqrt[Cos[c] - I*Sin[c]]*Sqrt[Cos[c] + E^((2*I)*d*x)*(Cos[c] + I*Sin[c]) - I*S
in[c]])] + ArcTanh[Sqrt[Cos[c] + E^((2*I)*d*x)*(Cos[c] + I*Sin[c]) - I*Sin[c]]/Sqrt[Cos[c] - I*Sin[c]]])*Sqrt[
a - a*Cos[c + d*x]]*(Cos[c/2] + I*Sin[c/2])*Sqrt[Cos[c] - I*Sin[c]]*Sqrt[((1 + E^((2*I)*d*x))*Cos[c] + I*(-1 +
 E^((2*I)*d*x))*Sin[c])/E^(I*d*x)])/(d*(I*(-1 + E^(I*d*x))*Cos[c/2] - (1 + E^(I*d*x))*Sin[c/2])*Sqrt[2*(1 + E^
((2*I)*d*x))*Cos[c] + (2*I)*(-1 + E^((2*I)*d*x))*Sin[c]])

________________________________________________________________________________________

Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(83\) vs. \(2(40)=80\).
time = 0.20, size = 84, normalized size = 1.75

method result size
default \(\frac {\sqrt {2}\, \sqrt {\frac {\cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}}\, \sqrt {-2 \left (-1+\cos \left (d x +c \right )\right ) a}\, \sin \left (d x +c \right ) \arctanh \left (\sqrt {\frac {\cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}}\right )}{d \sqrt {\cos \left (d x +c \right )}\, \left (-1+\cos \left (d x +c \right )\right )}\) \(84\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a-a*cos(d*x+c))^(1/2)/cos(d*x+c)^(1/2),x,method=_RETURNVERBOSE)

[Out]

1/d*2^(1/2)*(cos(d*x+c)/(1+cos(d*x+c)))^(1/2)*(-2*(-1+cos(d*x+c))*a)^(1/2)*sin(d*x+c)*arctanh((cos(d*x+c)/(1+c
os(d*x+c)))^(1/2))/cos(d*x+c)^(1/2)/(-1+cos(d*x+c))

________________________________________________________________________________________

Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 148 vs. \(2 (40) = 80\).
time = 0.59, size = 148, normalized size = 3.08 \begin {gather*} \frac {\sqrt {-a} \arctan \left ({\left (\cos \left (2 \, d x + 2 \, c\right )^{2} + \sin \left (2 \, d x + 2 \, c\right )^{2} + 2 \, \cos \left (2 \, d x + 2 \, c\right ) + 1\right )}^{\frac {1}{4}} \sin \left (\frac {1}{2} \, \arctan \left (\sin \left (2 \, d x + 2 \, c\right ), \cos \left (2 \, d x + 2 \, c\right ) + 1\right )\right ) + \sin \left (d x + c\right ), {\left (\cos \left (2 \, d x + 2 \, c\right )^{2} + \sin \left (2 \, d x + 2 \, c\right )^{2} + 2 \, \cos \left (2 \, d x + 2 \, c\right ) + 1\right )}^{\frac {1}{4}} \cos \left (\frac {1}{2} \, \arctan \left (\sin \left (2 \, d x + 2 \, c\right ), \cos \left (2 \, d x + 2 \, c\right ) + 1\right )\right ) + \cos \left (d x + c\right )\right )}{d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a-a*cos(d*x+c))^(1/2)/cos(d*x+c)^(1/2),x, algorithm="maxima")

[Out]

sqrt(-a)*arctan2((cos(2*d*x + 2*c)^2 + sin(2*d*x + 2*c)^2 + 2*cos(2*d*x + 2*c) + 1)^(1/4)*sin(1/2*arctan2(sin(
2*d*x + 2*c), cos(2*d*x + 2*c) + 1)) + sin(d*x + c), (cos(2*d*x + 2*c)^2 + sin(2*d*x + 2*c)^2 + 2*cos(2*d*x +
2*c) + 1)^(1/4)*cos(1/2*arctan2(sin(2*d*x + 2*c), cos(2*d*x + 2*c) + 1)) + cos(d*x + c))/d

________________________________________________________________________________________

Fricas [A]
time = 0.44, size = 155, normalized size = 3.23 \begin {gather*} \left [\frac {\sqrt {a} \log \left (\frac {4 \, \sqrt {-a \cos \left (d x + c\right ) + a} {\left (2 \, \cos \left (d x + c\right )^{2} + 3 \, \cos \left (d x + c\right ) + 1\right )} \sqrt {a} \sqrt {\cos \left (d x + c\right )} - {\left (8 \, a \cos \left (d x + c\right )^{2} + 8 \, a \cos \left (d x + c\right ) + a\right )} \sin \left (d x + c\right )}{\sin \left (d x + c\right )}\right )}{2 \, d}, \frac {\sqrt {-a} \arctan \left (\frac {\sqrt {-a \cos \left (d x + c\right ) + a} \sqrt {-a} {\left (2 \, \cos \left (d x + c\right ) + 1\right )}}{2 \, a \sqrt {\cos \left (d x + c\right )} \sin \left (d x + c\right )}\right )}{d}\right ] \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a-a*cos(d*x+c))^(1/2)/cos(d*x+c)^(1/2),x, algorithm="fricas")

[Out]

[1/2*sqrt(a)*log((4*sqrt(-a*cos(d*x + c) + a)*(2*cos(d*x + c)^2 + 3*cos(d*x + c) + 1)*sqrt(a)*sqrt(cos(d*x + c
)) - (8*a*cos(d*x + c)^2 + 8*a*cos(d*x + c) + a)*sin(d*x + c))/sin(d*x + c))/d, sqrt(-a)*arctan(1/2*sqrt(-a*co
s(d*x + c) + a)*sqrt(-a)*(2*cos(d*x + c) + 1)/(a*sqrt(cos(d*x + c))*sin(d*x + c)))/d]

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {\sqrt {- a \left (\cos {\left (c + d x \right )} - 1\right )}}{\sqrt {\cos {\left (c + d x \right )}}}\, dx \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a-a*cos(d*x+c))**(1/2)/cos(d*x+c)**(1/2),x)

[Out]

Integral(sqrt(-a*(cos(c + d*x) - 1))/sqrt(cos(c + d*x)), x)

________________________________________________________________________________________

Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 122 vs. \(2 (40) = 80\).
time = 0.52, size = 122, normalized size = 2.54 \begin {gather*} \frac {2 \, \sqrt {a} \log \left (\frac {2 \, {\left (\tan \left (\frac {1}{4} \, d x + \frac {1}{4} \, c\right )^{2} + 2 \, \sqrt {2} - \sqrt {\tan \left (\frac {1}{4} \, d x + \frac {1}{4} \, c\right )^{4} - 6 \, \tan \left (\frac {1}{4} \, d x + \frac {1}{4} \, c\right )^{2} + 1} + 1\right )}}{{\left | -2 \, \tan \left (\frac {1}{4} \, d x + \frac {1}{4} \, c\right )^{2} + 4 \, \sqrt {2} + 2 \, \sqrt {\tan \left (\frac {1}{4} \, d x + \frac {1}{4} \, c\right )^{4} - 6 \, \tan \left (\frac {1}{4} \, d x + \frac {1}{4} \, c\right )^{2} + 1} - 2 \right |}}\right ) \mathrm {sgn}\left (\sin \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}{d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a-a*cos(d*x+c))^(1/2)/cos(d*x+c)^(1/2),x, algorithm="giac")

[Out]

2*sqrt(a)*log(2*(tan(1/4*d*x + 1/4*c)^2 + 2*sqrt(2) - sqrt(tan(1/4*d*x + 1/4*c)^4 - 6*tan(1/4*d*x + 1/4*c)^2 +
 1) + 1)/abs(-2*tan(1/4*d*x + 1/4*c)^2 + 4*sqrt(2) + 2*sqrt(tan(1/4*d*x + 1/4*c)^4 - 6*tan(1/4*d*x + 1/4*c)^2
+ 1) - 2))*sgn(sin(1/2*d*x + 1/2*c))/d

________________________________________________________________________________________

Mupad [F]
time = 0.00, size = -1, normalized size = -0.02 \begin {gather*} \int \frac {\sqrt {a-a\,\cos \left (c+d\,x\right )}}{\sqrt {\cos \left (c+d\,x\right )}} \,d x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a - a*cos(c + d*x))^(1/2)/cos(c + d*x)^(1/2),x)

[Out]

int((a - a*cos(c + d*x))^(1/2)/cos(c + d*x)^(1/2), x)

________________________________________________________________________________________